'''在下面的混乱中找到罕见的字符'''

'''解法1： 罕见字符 = 少于平均频率

算法：slurp text
    使用字典对其进行循环，计算每个字符的出现次数，
    计算出现次数的全局平均值(即总字符数/不同字符数)，
    再次循环打印那些频率低于平均值的字符
'''
# import collections
# s = ''.join([line.rstrip() for line in open('2_ocr.txt')])
# # OCCURRENCES = {}
# # 优化
# OCCURRENCES = collections.OrderedDict()
# for c in s:
#     # 计算每个字符的出现次数，如果该字符没有默认为0
#     OCCURRENCES[c] = OCCURRENCES.get(c, 0) + 1

# avgOC = len(s) // len(OCCURRENCES)

# print(''.join([c for c in s if OCCURRENCES[c] < avgOC]))


'''解法2'''
text = ''.join([line.rstrip() for line in open('2_ocr.txt')])
output = ''
counts = {}
for c in text:
    if c in counts:
        continue
    counts[c] = text.count(c)
    if counts[c] < 100:
        output += c

print(output)